.section .text
.global _entry
_entry:
    # 设置栈指针
    la sp, stack_top
    
       
   
    # 清零BSS段
    la a0, __bss_start
    la a1, __bss_end
    jal zero_bss

    

    # 跳转到C主函数
    call start

spin:
    j spin

# BSS段清零函数
zero_bss:
    beq a0, a1, zero_done
    sw zero, 0(a0)
    addi a0, a0, 4
    j zero_bss
zero_done:
    ret